{{extend 'user_admin_layout.html'}}

{{block sub_menu}}
{{sidemenu('sidemenu','user_admin/users')}}
{{end}}

{{block content_main}}
{{use "jquery", css_only=True}}
<div class="row-fluid">
    <div class="span2 well">
        {{if can_modify:}}
        <a href="{{=url_for('plugs.user_admin.views_admin.UserView.edit_image')}}" title="{{=_('Click to change portrait')}}"><img src="{{=image_url}}" class="portrait"/></a>
        {{else:}}
        <img src="{{=image_url}}" class="portrait"/>
        {{pass}}
    </div>
    <div class="span5">
        <h2>{{=_('User Information')}}</h2>
        <div class="box-body">
            {{<< view}}
            <div style="padding:5px;">
            {{if request.user.is_superuser:}}
            <a class="btn btn-green" href="{{=url_for('plugs.user_admin.views_admin.UsersManageView.edit',id=object.id)}}">{{=_('Edit')}}</a>
            {{elif object.id==request.user.id:}}
            <a class="btn btn-green" href="{{=url_for('plugs.user_admin.views_admin.UserView.edit')}}">{{=_('Edit')}}</a>
            {{pass}}
            {{if request.user.is_superuser:}}
            <a class="btn btn-blue" href="{{=url_for('plugs.user_admin.views_admin.UsersManageView.delete',id=object.id)}}" onclick="return confirm('{{=_('Do you really wnat to delete the user?')}}');">{{=_('Delete')}}</a>
            {{pass}}
            </div>
            <h2>User Groups</h2>
            <table class="table">
            <thead><tr><th>Group name</th></tr></thead>
            {{for usergroup in object.groups.all().order_by('name'):}}
                <tr><td>{{=usergroup.name}}</td></tr>
            {{pass}}
            </table>
        </div>
    </div>
</div>
{{end}}
